local blank_effect = fk.CreateSkill {
  name = "blank_effect"
}
Fk:loadTranslationTable{
  ["blank_effect"] = "",
}
blank_effect:addEffect(fk.GamePrepared, {
    is_delay_effect = true,
  priority = 0.0001,
  global = true,  mute = true,
  can_refresh = function(self, event, target, player, data)
    return not table.contains(player.room.disabled_packs, "skinchange")
  end,
  on_refresh = function(self, event, target, player, data)
    for _, p in ipairs(player.room.alive_players) do
      if not p:hasSkill("skinchange") then 
        player.room:handleAddLoseSkills(player, "skinchange", nil, false, true)
      end
    end
  end,
})

blank_effect:addEffect(fk.SkillEffect, {
    is_delay_effect = true,  mute = true,  global = true,
  can_refresh = function (self, event, target, player, data)
    return target == player and player:hasSkill("liangyuan") and data.skill.name == "liangyuan" and
    (player.general == "skin__caoxiancaohua" or player.deputyGeneral == "skin__caoxiancaohua" or 
    player.general == "skin2__caoxiancaohua" or player.deputyGeneral == "skin2__caoxiancaohua")
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    if player.general == "skin__caoxiancaohua" then
      player.general = "skin2__caoxiancaohua"
      room:broadcastProperty(player, "general")
    return end
    if player.general == "skin2__caoxiancaohua" then
      player.general = "skin__caoxiancaohua"
      room:broadcastProperty(player, "general")
    return end
    if player.deputyGeneral == "skin__caoxiancaohua" then
      player.deputyGeneral = "skin2__caoxiancaohua"
      room:broadcastProperty(player, "deputyGeneral")
    return end
    if player.deputyGeneral == "skin2__caoxiancaohua" then
      player.deputyGeneral = "skin__caoxiancaohua"
      room:broadcastProperty(player, "deputyGeneral")
    return end
    
  end,
})

blank_effect:addEffect(fk.GameStart, {
    is_delay_effect = true,  mute = true,  global = true,
  can_refresh = function (self, event, target, player, data)
    return
    (player.general == "skin__caoxiancaohua" or player.deputyGeneral == "skin__caoxiancaohua" or 
    player.general == "skin2__caoxiancaohua" or player.deputyGeneral == "skin2__caoxiancaohua") and 
    not table.contains(player.room.disabled_packs, "skin")
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    if player.general == "skin__caoxiancaohua" or player.deputyGeneral == "skin__caoxiancaohua" then
    --  room:doSuperLightBox("packages/blank/qml/skin__caoxiancaohua.qml")
      room:doSuperLightBox("packages/blank/qml/skin__caoxiancaohua-daiji.qml")
      room:delay(2000)
    elseif player.general == "skin2__caoxiancaohua" or player.deputyGeneral == "skin2__caoxiancaohua" then
      room:doSuperLightBox("packages/blank/qml/skin2__caoxiancaohua.qml")
      room:delay(2000)
    end

  end,
})

blank_effect:addEffect(fk.AfterCardsMove, {
    is_delay_effect = true,  mute = true,  global = true,
  can_refresh = function (self, event, target, player, data)
    return player.room.current == player and #player:getCardIds("h") >= 50 and not player:hasSkill("blank_discard")
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:handleAddLoseSkills(player, "blank_discard")
  end,
})

blank_effect:addEffect(fk.AfterCardsMove, {
    global = true,
    is_delay_effect = true,  mute = true,
  can_refresh = function (self, event, target, player, data)
    return player.room.current == player and #player:getCardIds("h") <= 50 and player:hasSkill("blank_discard")
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:handleAddLoseSkills(player, "-blank_discard")
  end,
})

--blank_effect:addEffect(fk.GamePrepared, {
  --is_delay_effect = true,
  --global = true,  mute = true,
  --can_refresh = function(self, event, target, player, data)
    --return player.role == "lord" and player.room:isGameMode("role_mode") and not table.contains(player.room.disabled_packs, "!--开启的包名--!") 
  --end,
  --on_refresh = function(self, event, target, player, data)
    --player.room:handleAddLoseSkills(player, "!--给主公增加的技能--!", nil, false, true)
  --end,
--})

return blank_effect